﻿addLoadEvent(CreateNewFileInput);

function CreateNewFileInput(){
    var upload=$("uploadicon");
    var upForm=document.createElement("form");
    upForm.action="";
    upForm.method = "POST";
    
    
	var newFile = document.createElement("input");
	newFile.setAttribute("value","file");
	newFile.type = "file";
	newFile.className = "file";
	newFile.name = "headfile";
	newFile.size = "1";
	newFile.onchange = function(){
	    alert(this.value);
	}
	document.body.appendChild(newFile);
	
	
	upload.onclick=	function(){
	    newFile.click();
	}
	}